package com.spring.dynamic.jar.core;

import java.io.File;
import java.net.MalformedURLException;

/**
 * AddonUtil
 *
 * @author Brant Liu <br> 邮箱：<br>lbf1988@qq.com <br>日期：<br>2018/04/09
 * @version 1.0.0
 */
public class AddonUtil {
    public static void assembleAddon(File file, String basePackages){
        AddonClassLoader addonClassLoader = new AddonClassLoader(file);
        try {
            addonClassLoader.loadJar();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        AddonScanner scanner = new AddonScanner(ContextHolder.getDefaultListableBeanFactory());
        scanner.scan(basePackages);
    }
}

